#ifndef __LXZ_CCORE_CMD_H__
#define __LXZ_CCORE_CMD_H__

#define LXZAT_SIM_IMSI "460018621721170"
#define LXZAT_SIM_ICCID  "89860120818621721170"

#define LXZAT_MAX_LEN_USR 128
#define LXZAT_MAX_LEN_PWD 128
#define LXZAT_MAX_LEN_APN 128
#define LXZAT_MAX_LEN_IPV4 15

#define LXZAT_MAX_CID_PDP_CTXT 15
#define LXZAT_MIN_CID_PDP_CTXT 0
#define LXZAT_MAX_CID_ALLOWED 11
#define LXZAT_MIN_CID_ALLOWED 1

#define LXZAT_MAX_LEN_ICCID 32

#ifdef LXZAT_SIMU
  #ifdef LXZAT_WIN32
    #define LXZAT_VSIM1_ROOT_DIRECTORY "./vSIM1"
  #else /* LXZAT_WIN32 */
    #define LXZAT_VSIM1_ROOT_DIRECTORY "/data/vSIM1"
  #endif/* LXZAT_WIN32 */
#else /* LXZAT_SIMU */
  #define LXZAT_VSIM1_ROOT_DIRECTORY "/data/vSIM1"
#endif/* LXZAT_SIMU */

typedef enum _LXZAT_PDP_AUTHTYPE_E
{
    E_LPAT_NONE  = 0,
    E_LPAT_PAP   = 1,
    E_LPAT_CHAP  = 2,
    E_LPAT_PAPCHAP  = 3,

    E_LPAT_MAX = 0xFF
}LXZAT_PDP_AUTHTYPE_E;

typedef struct _lxzat_pdpcfg_t
{
    uint08    ut_user_name[LXZAT_MAX_LEN_USR + 1];
    uint08    ut_pass_word[LXZAT_MAX_LEN_PWD + 1];
    uint08    ut_net_apn[LXZAT_MAX_LEN_APN + 1];
    uint08    ut_net_iptype[16];
    sint32    it_auth_type;
}lxzat_pdpcfg_t;

typedef struct _lxzat_pdpinfo_t
{
    uint32   it_act_msecs;
    uint32   it_mark_ticks;
    sint32   it_pdp_state;
    uint08   pt_ip_host[LXZAT_MAX_LEN_IPV4+1];
    uint08   pt_ip_mask[LXZAT_MAX_LEN_IPV4+1];
    uint08   pt_ip_gateway[LXZAT_MAX_LEN_IPV4+1];
    uint08   pt_ip_1stdns[LXZAT_MAX_LEN_IPV4+1];
    uint08   pt_ip_2nddns[LXZAT_MAX_LEN_IPV4+1];
}lxzat_pdpinfo_t;

typedef enum 
{
    E_PDP_STATUS_IDLE,
    E_PDP_STATUS_ACTIVATING,
    E_PDP_STATUS_ACTIVATED,
    E_PDP_STATUS_DEACTIVATING
}GS_PDP_STATUS_E;

/*
 *  Description:
 *    Get the context of pdp-configuration.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Return: the context of pdp-configuration.
 */
lxzat_pdpcfg_t* lxzat_pdpcfg_f_get(sint32 i_id_pdpctxt);

/*
 *  Description:
 *    Reset the context of pdp-information.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Return: the status of operation.
 */
sint32 lxzat_pdpinfo_f_reset(sint32 i_id_pdpctxt);

/*
 *  Description:
 *    Get the context of pdp-information.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Return: the context of pdp-information.
 */
lxzat_pdpinfo_t* lxzat_pdpinfo_f_get(sint32 i_id_pdpctxt);

/*
 *  Description:
 *    active PDP-Context.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Param: i_id_pdpctxt, the ID of PDP-Context;
 *  Return: the status of operation.
 */
sint32 lxzat_pdpinfo_f_active(sint32 i_id_vspctxt, sint32 i_id_pdpctxt);

/*
 *  Description:
 *    deactive PDP-Context.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Param: i_id_pdpctxt, the ID of PDP-Context;
 *  Return: the status of operation.
 */
sint32 lxzat_pdpinfo_f_deactive(sint32 i_id_vspctxt, sint32 i_id_pdpctxt);

/*
 *  Description:
 *    Get the status of PDP-Context.
 *  Param: i_id_pdpctxt, the ID of PDP-Context;
 *  Param: p_cur_pdpstatus, the status of PDP-Context;
 *  Return: the status of operation.
 */
sint32 lxzat_pdpinfo_f_getstatus(sint32 i_id_pdpctxt, sint32 * p_cur_pdpstatus);

/*
 *  Description:
 *    Get the Ip of PDP-Context.
 *  Param: i_id_pdpctxt, the ID of PDP-Context;
 *  Param: p_buf_localip, the buffer of IP-address;
 *  Return: the status of operation.
 */
sint32 lxzat_pdpinfo_f_getipaddress(sint32 i_id_pdpctxt, uint08 * p_buf_ipaddr);

/*
 *  Description:
 *    Get the IP of interface-card.
 *  Param: p_buf_localip, the buffer of IP-address;
 *  Return: the status of operation.
 */
sint32 lxzat_ifconfig_f_getip(uint08 * p_buf_localip);

/*
 *  Description:
 *    Get registration status.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Return: the status of registration.
 */
sint32 lxzat_creg_f_getstatus(sint32 i_id_vspctxt);

/*
 *  Description:
 *    Update registration status.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Param: i_creg_newstatus, the new-status of registration;
 *  Return: the status of registration.
 */
sint32 lxzat_creg_f_setstatus(sint32 i_id_vspctxt, sint32 i_creg_newstatus);

/*
 *  Description:
 *    Get SIM card status.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Return: the status of SIM-Card.
 */
sint32 lxzat_cpin_f_getstatus(sint32 i_id_vspctxt);

/*
 *  Description:
 *    Update SIM card status.
 *  Param: i_id_vspctxt, the ID of serial-port;
 *  Param: i_cpin_newstatus, the new-status of SIM-Card;
 *  Return: the status of SIM-Card.
 */
sint32 lxzat_cpin_f_setstatus(sint32 i_id_vspctxt, sint32 i_cpin_newstatus);

#endif/*__LXZ_CCORE_CMD_H__*/

